﻿using System;

namespace _55_对null进行判断_运算符
{
    class Program
    {
        static void Main(string[] args)
        {
            A a = new A();
            a?.Work();


            A p = null;
            //p?.Work(){
            //    Console.WriteLine("fff");
            //};

            if (p==null)
            {
                Console.WriteLine("由于p值为空-所以输出这一条。");

            }

            Console.Read();

        }
    }

    class A 
    {
        public void Work() => Console.WriteLine("{0}方法被调用", nameof(Work));


    }
}
